package com.xc.smart.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;

/**
 *  图片表
 *   @author mtl
 *   2021/6/11
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
@TableName(value = "img")
public class Img implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 图片名字
     */
    @TableField(value = "`name`")
    private String name;

    /**
     * 图片地址
     */
    @TableField(value = "url")
    private String url;

    /**
     * 图片分类
     */
    @TableField(value = "img_type")
    private String imgType;

    /**
     * 状态 1存在 2逻辑删除
     */
    @TableField(value = "`status`")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_date")
    private Date createDate;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_NAME = "name";

    public static final String COL_URL = "url";

    public static final String COL_IMG_TYPE = "img_type";

    public static final String COL_STATUS = "status";

    public static final String COL_CREATE_DATE = "create_date";


    public Img(String name, String url, String imgType) {
        this.name = name;
        this.url = url;
        this.imgType = imgType;
        this.createDate=new Date();
    }
}